package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.anno.RpcProvider;
import com.lagou.rpc.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: yx
 * @date: 2022/1/13 10:44
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {

    @RpcProvider
    private IUserService iUserService;

    @GetMapping("/getUserById")
    public User getUserById(@RequestParam("id") Integer id){
        User user = iUserService.getById(id);
        return user;
    }

}
